/**
 * Boton HR para el htmleditor
 * @autor joshua
 * @fecha 20 de marzo de 2012
 **/
Ext.ns('Extmx.ux.htmleditor.ComboTamano');

Extmx.ux.htmleditor.ComboTamano = Ext.extend(Ext.util.Observable, {
    init: function(cmp){
        this.cmp = cmp;
        this.cmp.on('render', this.onRender, this);
    },
    onRender: function(){

        var c=new Ext.form.ComboBox({
            emptyText: 'Seleccionar',
            triggerAction: 'all',
            editable: false,
            mode: 'local',
            width:120,
            valueField: 'size',
            displayField: 'nombre',
            store: new Ext.data.ArrayStore({
                fields: [
                    'size',
                    'nombre'
                ],
                data: [[13, 'Normal 13'], [15, 'Titulo 15'],[17,'Leyenda 17']]
            }),
            listeners:{
                scope: this,
                select : function (a,s){
                    //log(this);
                    //this.cmp.relayCmd('bold');
                    /*this.cmp.insertAtCursor('<style type="text/css">blockquote:before, blockquote:after, q:before, q:after {    content: none;}blockquote:before, blockquote:after, q:before, q:after {    content: none;}blockquote {    background: url("../../img/home/todas/quote.png") no-repeat scroll left top transparent;    color:#787878;    font-size: 17px;	font-weight:bold;	border: 1px solid red;    line-height: 22px;	width:200px;    margin-bottom: 20px;    margin-top: 20px;padding-left: 30px;}blockquote, q {quotes: none;}blockquote div{font-size: 15px;color:#BCBCBC;}</style><blockquote>'+
		'Pellentesque non diam et tortor dignissim bibendum. Neque sit amet mauris egestas quis mattis velit fringilla. Curabitur viver justo sed scelerisque.'+
		'<div>Josue Hernandez</div>'+
	'</blockquote>');*/

                    this.cmp.insertAtCursor('&nbsp; <blockquote>'+
		'Pellentesque non diam et tortor dignissim bibendum. Neque sit amet mauris egestas quis mattis velit fringilla. Curabitur viver justo sed scelerisque.'+
		'<div>Josue Hernandez</div>'+
	'</blockquote> &nbsp;');


                    //this.cmp.execCmd('bold');
                }
            }
        });


        this.cmp.getToolbar().add(c)/*addButton([{
            iconCls: 'x-edit-custom', //your iconCls here
            handler: function(){
                this.cmp.insertAtCursor('<hr>');
            },
            scope: this,
            tooltip: 'horizontal ruler',
            overflowText: 'horizontal ruler'
        }]);*/
    }
});